<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Configuration &mdash; toughradius 5.0 文档</title>
    
    <link rel="stylesheet" href="../static/default.css" type="text/css" />
    <link rel="stylesheet" href="../static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '5.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../static/jquery.js"></script>
    <script type="text/javascript" src="../static/underscore.js"></script>
    <script type="text/javascript" src="../static/doctools.js"></script>
    <script type="text/javascript" src="../static/translations.js"></script>
    <link rel="top" title="toughradius 5.0 文档" href="../index.html" />
    <link rel="next" title="Installation and Upgrade" href="installation.html" />
    <link rel="prev" title="Quick start" href="quickstart.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>导航</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="总目录"
             accesskey="I">索引</a></li>
        <li class="right" >
          <a href="installation.html" title="Installation and Upgrade"
             accesskey="N">下一页</a> |</li>
        <li class="right" >
          <a href="quickstart.html" title="Quick start"
             accesskey="P">上一页</a> |</li>
        <li><a href="../index.html">toughradius 5.0 文档</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="configuration">
<h1>Configuration<a class="headerlink" href="#configuration" title="永久链接至标题">¶</a></h1>
<div class="section" id="main-configuration-file">
<h2>Main configuration file<a class="headerlink" href="#main-configuration-file" title="永久链接至标题">¶</a></h2>
<div class="highlight-javascript"><div class="highlight"><pre><span class="p">{</span>
    <span class="s2">&quot;api&quot;</span> <span class="o">:</span> <span class="p">{</span>
        <span class="s2">&quot;debug&quot;</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
        <span class="s2">&quot;host&quot;</span> <span class="o">:</span> <span class="s2">&quot;0.0.0.0&quot;</span><span class="p">,</span>
        <span class="s2">&quot;port&quot;</span> <span class="o">:</span> <span class="mi">1815</span><span class="p">,</span>
        <span class="s2">&quot;secret&quot;</span> <span class="o">:</span> <span class="s2">&quot;CRTCcMB7tfnXU8aXIyfavfuqruvXkNng&quot;</span>
    <span class="p">},</span>
    <span class="s2">&quot;clients&quot;</span> <span class="o">:</span> <span class="s2">&quot;!include:{CONFDIR}/clients.json&quot;</span><span class="p">,</span>
    <span class="s2">&quot;logger&quot;</span> <span class="o">:</span> <span class="s2">&quot;!include:{CONFDIR}/logger.json&quot;</span><span class="p">,</span>
    <span class="s2">&quot;radiusd&quot;</span> <span class="o">:</span> <span class="p">{</span>
        <span class="s2">&quot;acct_port&quot;</span> <span class="o">:</span> <span class="mi">1813</span><span class="p">,</span>
        <span class="s2">&quot;auth_port&quot;</span> <span class="o">:</span> <span class="mi">1812</span><span class="p">,</span>
        <span class="s2">&quot;adapter&quot;</span> <span class="o">:</span> <span class="s2">&quot;rest&quot;</span><span class="p">,</span>
        <span class="s2">&quot;debug&quot;</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
        <span class="s2">&quot;dictionary&quot;</span> <span class="o">:</span> <span class="s2">&quot;{CONFDIR}/dictionarys/dictionary&quot;</span><span class="p">,</span>
        <span class="s2">&quot;free_auth_input_limit&quot;</span> <span class="o">:</span> <span class="mi">1048576</span><span class="p">,</span>
        <span class="s2">&quot;free_auth_output_limit&quot;</span> <span class="o">:</span> <span class="mi">1048576</span><span class="p">,</span>
        <span class="s2">&quot;free_auth_limit_code&quot;</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
        <span class="s2">&quot;free_auth_domain&quot;</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
        <span class="s2">&quot;host&quot;</span> <span class="o">:</span> <span class="s2">&quot;0.0.0.0&quot;</span><span class="p">,</span>
        <span class="s2">&quot;max_session_timeout&quot;</span> <span class="o">:</span> <span class="mi">86400</span><span class="p">,</span>
        <span class="s2">&quot;pass_pwd&quot;</span> <span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
        <span class="s2">&quot;pass_userpwd&quot;</span> <span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
        <span class="s2">&quot;pool_size&quot;</span> <span class="o">:</span> <span class="mi">2</span><span class="p">,</span>
        <span class="s2">&quot;request_timeout&quot;</span> <span class="o">:</span> <span class="mi">5</span>
    <span class="p">},</span>
    <span class="s2">&quot;adapters&quot;</span> <span class="o">:</span> <span class="p">{</span>
        <span class="s2">&quot;rest&quot;</span> <span class="o">:</span> <span class="p">{</span>
            <span class="s2">&quot;url&quot;</span> <span class="o">:</span> <span class="s2">&quot;http://127.0.0.1:1815/api/v1/radtest&quot;</span><span class="p">,</span>
            <span class="s2">&quot;format&quot;</span> <span class="o">:</span> <span class="s2">&quot;json&quot;</span><span class="p">,</span>
            <span class="s2">&quot;secret&quot;</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
            <span class="s2">&quot;radattrs&quot;</span> <span class="o">:</span> <span class="p">[]</span>
        <span class="p">}</span>
    <span class="p">},</span>
    <span class="s2">&quot;system&quot;</span> <span class="o">:</span> <span class="p">{</span>
        <span class="s2">&quot;tz&quot;</span> <span class="o">:</span> <span class="s2">&quot;CST-8&quot;</span>
    <span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<div class="section" id="api-configuration">
<h3>api configuration<a class="headerlink" href="#api-configuration" title="永久链接至标题">¶</a></h3>
<ul class="simple">
<li>debug: enable debug mode</li>
<li>host: api server listen host</li>
<li>port: api server listen port</li>
<li>secret: http message sign secret</li>
<li>adapter: current adapter mode</li>
</ul>
</div>
<div class="section" id="radiusd-configuration">
<h3>radiusd configuration<a class="headerlink" href="#radiusd-configuration" title="永久链接至标题">¶</a></h3>
<ul class="simple">
<li>debug: enable debug mode</li>
<li>host: radiusd listen host</li>
<li>auth_port: radius auth listen port</li>
<li>acct_port: radius acct listen port</li>
<li>dictionary: include an additional  Radius protocol dictionary file directory path</li>
<li>max_session_timeout: Radius Accept Attr Session-Timeout</li>
<li>pass_pwd: Radius Auth ignore password</li>
<li>pass_userpwd: Radius Auth ignore username and password</li>
<li>request_timeout: max radius request timeout</li>
</ul>
</div>
<div class="section" id="rest-adapters">
<h3>rest adapters<a class="headerlink" href="#rest-adapters" title="永久链接至标题">¶</a></h3>
<ul class="simple">
<li>url: backend server api url</li>
<li>format: http message format</li>
<li>secret: http message sign secret</li>
<li>radattrs: Radius attrs send to  backend server</li>
</ul>
</div>
<div class="section" id="clients-configuration">
<h3>clients configuration<a class="headerlink" href="#clients-configuration" title="永久链接至标题">¶</a></h3>
<p>include an additional clients configuration file</p>
</div>
<div class="section" id="logger-configuration">
<h3>logger configuration<a class="headerlink" href="#logger-configuration" title="永久链接至标题">¶</a></h3>
<p>include an additional logger configuration file</p>
</div>
</div>
<div class="section" id="logging-configuration-file">
<h2>Logging configuration file<a class="headerlink" href="#logging-configuration-file" title="永久链接至标题">¶</a></h2>
<p>This is a standard logging configuration for Python</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="p">{</span>
    <span class="s2">&quot;version&quot;</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
    <span class="s2">&quot;disable_existing_loggers&quot;</span> <span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
    <span class="s2">&quot;formatters&quot;</span> <span class="o">:</span> <span class="p">{</span>
        <span class="s2">&quot;verbose&quot;</span> <span class="o">:</span> <span class="p">{</span>
            <span class="s2">&quot;format&quot;</span> <span class="o">:</span> <span class="s2">&quot;[%(asctime)s %(name)s-%(process)d] [%(levelname)s] %(message)s&quot;</span><span class="p">,</span>
            <span class="s2">&quot;datefmt&quot;</span> <span class="o">:</span> <span class="s2">&quot;%Y-%m-%d %H:%M:%S&quot;</span>
        <span class="p">},</span>
        <span class="s2">&quot;simple&quot;</span> <span class="o">:</span> <span class="p">{</span>
            <span class="s2">&quot;format&quot;</span> <span class="o">:</span> <span class="s2">&quot;%(asctime)s %(levelname)s %(message)s&quot;</span>
        <span class="p">}</span>
    <span class="p">},</span>
    <span class="s2">&quot;handlers&quot;</span> <span class="o">:</span> <span class="p">{</span>
        <span class="s2">&quot;null&quot;</span> <span class="o">:</span> <span class="p">{</span>
            <span class="s2">&quot;level&quot;</span> <span class="o">:</span> <span class="s2">&quot;DEBUG&quot;</span><span class="p">,</span>
            <span class="s2">&quot;class&quot;</span> <span class="o">:</span> <span class="s2">&quot;logging.NullHandler&quot;</span>
        <span class="p">},</span>
        <span class="s2">&quot;debug&quot;</span> <span class="o">:</span> <span class="p">{</span>
            <span class="s2">&quot;level&quot;</span> <span class="o">:</span> <span class="s2">&quot;DEBUG&quot;</span><span class="p">,</span>
            <span class="s2">&quot;class&quot;</span> <span class="o">:</span> <span class="s2">&quot;logging.StreamHandler&quot;</span><span class="p">,</span>
            <span class="s2">&quot;formatter&quot;</span> <span class="o">:</span> <span class="s2">&quot;verbose&quot;</span>
        <span class="p">},</span>
        <span class="s2">&quot;info&quot;</span> <span class="o">:</span> <span class="p">{</span>
            <span class="s2">&quot;level&quot;</span> <span class="o">:</span> <span class="s2">&quot;DEBUG&quot;</span><span class="p">,</span>
            <span class="s2">&quot;class&quot;</span> <span class="o">:</span> <span class="s2">&quot;logging.handlers.TimedRotatingFileHandler&quot;</span><span class="p">,</span>
            <span class="s2">&quot;when&quot;</span> <span class="o">:</span> <span class="s2">&quot;d&quot;</span><span class="p">,</span>
            <span class="s2">&quot;interval&quot;</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
            <span class="s2">&quot;backupCount&quot;</span> <span class="o">:</span> <span class="mi">50</span><span class="p">,</span>
            <span class="s2">&quot;delay&quot;</span> <span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="s2">&quot;filename&quot;</span> <span class="o">:</span> <span class="s2">&quot;/var/log/toughradius/info.log&quot;</span><span class="p">,</span>
            <span class="s2">&quot;formatter&quot;</span> <span class="o">:</span> <span class="s2">&quot;verbose&quot;</span>
        <span class="p">},</span>
        <span class="s2">&quot;error&quot;</span> <span class="o">:</span> <span class="p">{</span>
            <span class="s2">&quot;level&quot;</span> <span class="o">:</span> <span class="s2">&quot;ERROR&quot;</span><span class="p">,</span>
            <span class="s2">&quot;class&quot;</span> <span class="o">:</span> <span class="s2">&quot;logging.handlers.TimedRotatingFileHandler&quot;</span><span class="p">,</span>
            <span class="s2">&quot;when&quot;</span> <span class="o">:</span> <span class="s2">&quot;d&quot;</span><span class="p">,</span>
            <span class="s2">&quot;interval&quot;</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
            <span class="s2">&quot;backupCount&quot;</span> <span class="o">:</span> <span class="mi">50</span><span class="p">,</span>
            <span class="s2">&quot;delay&quot;</span> <span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="s2">&quot;filename&quot;</span> <span class="o">:</span> <span class="s2">&quot;/var/log/toughradius/error.log&quot;</span><span class="p">,</span>
            <span class="s2">&quot;formatter&quot;</span> <span class="o">:</span> <span class="s2">&quot;verbose&quot;</span>
        <span class="p">}</span>
    <span class="p">},</span>
    <span class="s2">&quot;loggers&quot;</span> <span class="o">:</span> <span class="p">{</span>
        <span class="s2">&quot;&quot;</span> <span class="o">:</span> <span class="p">{</span>
            <span class="s2">&quot;handlers&quot;</span> <span class="o">:</span> <span class="p">[</span>
                <span class="s2">&quot;info&quot;</span><span class="p">,</span>
                <span class="s2">&quot;error&quot;</span><span class="p">,</span>
                <span class="s2">&quot;debug&quot;</span>
            <span class="p">],</span>
            <span class="s2">&quot;level&quot;</span> <span class="o">:</span> <span class="s2">&quot;DEBUG&quot;</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="nas-client-configuration-file">
<h2>Nas Client configuration file<a class="headerlink" href="#nas-client-configuration-file" title="永久链接至标题">¶</a></h2>
<p>Define nas access devices</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="p">{</span>
    <span class="s2">&quot;vendors&quot;</span> <span class="o">:</span> <span class="p">{</span>
        <span class="s2">&quot;std&quot;</span> <span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
        <span class="s2">&quot;alcatel&quot;</span> <span class="o">:</span> <span class="mi">3041</span><span class="p">,</span>
        <span class="s2">&quot;cisco&quot;</span> <span class="o">:</span> <span class="mi">9</span><span class="p">,</span>
        <span class="s2">&quot;h3c&quot;</span> <span class="o">:</span> <span class="mi">25506</span><span class="p">,</span>
        <span class="s2">&quot;huawei&quot;</span> <span class="o">:</span> <span class="mi">2011</span><span class="p">,</span>
        <span class="s2">&quot;juniper&quot;</span> <span class="o">:</span> <span class="mi">2636</span><span class="p">,</span>
        <span class="s2">&quot;microsoft&quot;</span> <span class="o">:</span> <span class="mi">311</span><span class="p">,</span>
        <span class="s2">&quot;mikrotik&quot;</span> <span class="o">:</span> <span class="mi">14988</span><span class="p">,</span>
        <span class="s2">&quot;openvpn&quot;</span> <span class="o">:</span> <span class="mi">19797</span>
    <span class="p">},</span>
    <span class="s2">&quot;defaults&quot;</span> <span class="o">:</span> <span class="p">{</span>
        <span class="s2">&quot;127.0.0.1&quot;</span> <span class="o">:</span> <span class="p">{</span>
            <span class="s2">&quot;nasid&quot;</span> <span class="o">:</span> <span class="s2">&quot;toughac&quot;</span><span class="p">,</span>
            <span class="s2">&quot;secret&quot;</span> <span class="o">:</span> <span class="s2">&quot;secret&quot;</span><span class="p">,</span>
            <span class="s2">&quot;coaport&quot;</span> <span class="o">:</span> <span class="mi">3799</span><span class="p">,</span>
            <span class="s2">&quot;vendor&quot;</span> <span class="o">:</span> <span class="s2">&quot;std&quot;</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<ul>
<li><p class="first">vendors: Radius vendors define</p>
</li>
<li><dl class="first docutils">
<dt>defaults: nas client group</dt>
<dd><ul class="first last simple">
<li>nasid: nas attr NAS-Identifier</li>
<li>secret: share secret</li>
<li>coaport: coa service port</li>
<li>vendor: nas vendor type</li>
</ul>
</dd>
</dl>
</li>
</ul>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">內容目录</a></h3>
  <ul>
<li><a class="reference internal" href="#">Configuration</a><ul>
<li><a class="reference internal" href="#main-configuration-file">Main configuration file</a><ul>
<li><a class="reference internal" href="#api-configuration">api configuration</a></li>
<li><a class="reference internal" href="#radiusd-configuration">radiusd configuration</a></li>
<li><a class="reference internal" href="#rest-adapters">rest adapters</a></li>
<li><a class="reference internal" href="#clients-configuration">clients configuration</a></li>
<li><a class="reference internal" href="#logger-configuration">logger configuration</a></li>
</ul>
</li>
<li><a class="reference internal" href="#logging-configuration-file">Logging configuration file</a></li>
<li><a class="reference internal" href="#nas-client-configuration-file">Nas Client configuration file</a></li>
</ul>
</li>
</ul>

  <h4>上一个主题</h4>
  <p class="topless"><a href="quickstart.html"
                        title="上一章">Quick start</a></p>
  <h4>下一个主题</h4>
  <p class="topless"><a href="installation.html"
                        title="下一章">Installation and Upgrade</a></p>
  <h3>本页</h3>
  <ul class="this-page-menu">
    <li><a href="../sources/manual/configuration.txt"
           rel="nofollow">显示源代码</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>快速搜索</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="转向" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    输入相关的术语，模块，类或者函数名称进行搜索
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>导航</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="总目录"
             >索引</a></li>
        <li class="right" >
          <a href="installation.html" title="Installation and Upgrade"
             >下一页</a> |</li>
        <li class="right" >
          <a href="quickstart.html" title="Quick start"
             >上一页</a> |</li>
        <li><a href="../index.html">toughradius 5.0 文档</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; 版权所有 2017, jamiesun.
    </div>
  </body>
</html>